#ifndef _COUNTER_H_
#define _COUNTER_H_
#include "sys.h"
#ifdef __cplusplus
 extern "C" {
#endif

typedef struct CounterStructure{
	uint16_t times;
	uint16_t targetcnt;
}CounterStructure;

uint16_t GetCounterTimes(CounterStructure* counter);
uint16_t GetCounterTargetCNT(CounterStructure* counter);
void SetCounter(CounterStructure* counter,uint32_t pul);
uint32_t GetCurrentCount(uint16_t ID);
uint32_t GetITCurrentCount(uint16_t ID);
void SetTIMCCR(uint16_t ID,uint32_t targetcount);
#ifdef __cplusplus
}
#endif
#endif 


